import request from '@/utils/request'


// 查询用户地址
export function getUserAddress(userId) {
  return request({
    url: '/order/address/list',
    method: 'get',
    params: { userId }
  })
}

// 添加
export function addAddress(data) {
  return request({
    url: '/order/address/add',
    method: 'post',
    data
  })
}

// 编辑
export function editAddress(data) {
  return request({
    url: '/order/address/edit',
    method: 'post',
    data
  })
}

// 删除
export function deleteAddress(id) {
  return request({
    url: '/order/address/delete',
    method: 'post',
    params: { id }
  })
}


// 获取区县列表
export function getDistricts(pid) {
  return request({ 
    url: `/order/order/district/${pid}`, 
    method: 'get' 
  })

}
